/* Player 12 "Recolhível". Same engine as the others (players/player-func.js).
   A panel docked to the right edge that slides off and leaves only its tab.
   The fold is a checkbox, so it works with the engine untouched. */

.pl12 {
	--pl-border: color-mix(in srgb, var(--pl-fg, #16181f) 14%, transparent);
	--pl-muted: color-mix(in srgb, var(--pl-fg, #16181f) 58%, transparent);
	--pl-hover: color-mix(in srgb, var(--pl-fg, #16181f) 8%, transparent);
}

.pl12__check { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

.pl12__panel {
	position: fixed;
	right: 0;
	bottom: 26px;
	z-index: 1045;
	width: 268px;
	padding-left: 22px;
	color: var(--pl-fg, #16181f);
	background: var(--pl-bg, #ffffff);
	border: 1px solid var(--pl-border);
	border-right: 0;
	border-radius: 12px 0 0 12px;
	font-size: 13px;
	line-height: 1.3;
	transition: transform 0.3s ease;
}

/* Folded: only the tab stays on the screen */
.pl12__check:checked ~ .pl12__panel { transform: translateX(calc(100% - 22px)); }

.pl12__foldbtn {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	color: var(--pl-muted);
	background: var(--pl-hover);
	border-radius: 12px 0 0 12px;
	cursor: pointer;
}

.pl12__foldbtn:hover { color: var(--pl-fg, #16181f); }
.pl12__foldbtn svg { transition: transform 0.3s ease; }
.pl12__check:checked ~ .pl12__panel .pl12__foldbtn svg { transform: rotate(180deg); }

.pl12__body { padding: 12px 14px 10px; }
.pl12__cover { display: none; }

.pl12__now {
	display: block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--pl-muted);
}

.pl12__track {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	margin-top: 2px;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
}

.pl12__ctrl {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 10px 11px 14px;
}

.pl12__play {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	padding: 0;
	color: var(--pl-bg, #ffffff);
	background: var(--pl-accent, #d75531);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.pl12__play:hover { filter: brightness(1.08); }
.pl12__play.inactive { display: none !important; }
.pl12__play svg { margin-left: 2px; }
.fallplayer-pause.pl12__play svg { margin-left: 0; }

.pl12__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	padding: 0;
	color: var(--pl-muted);
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.15s ease;
}

.pl12__btn:hover { color: var(--pl-fg, #16181f); }
.pl12__btn svg { width: 16px; height: 16px; }

.pl12__volume {
	position: relative !important;
	top: auto !important;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
}

/* The filled part comes from --pl-vol, written by the engine on every change */
.pl12__volume input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	margin: 0;
	background: linear-gradient(to right, var(--pl-accent, #d75531) 0 var(--pl-vol, 100%), var(--pl-hover) var(--pl-vol, 100%) 100%);
	border-radius: 999px;
	outline: none;
	cursor: pointer;
}

.pl12__volume input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: transparent; border-radius: 999px; }

.pl12__volume input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 13px;
	height: 13px;
	margin-top: -4.5px;
	background: var(--pl-accent, #d75531);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.pl12__volume input[type="range"]::-moz-range-track { height: 4px; background: transparent; border-radius: 999px; }

.pl12__volume input[type="range"]::-moz-range-thumb {
	width: 13px;
	height: 13px;
	background: var(--pl-accent, #d75531);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.bras-player__cast .cast-on,
.pl12.is-casting .bras-player__cast .cast-off { display: none; }
.pl12.is-casting .bras-player__cast .cast-on { display: block; }
.pl12.is-casting .bras-player__cast { color: var(--pl-accent, #d75531); }

/* Nothing on air */
.bras-player__offline {
	display: none;
	align-items: center;
	gap: 8px;
	color: var(--pl-muted);
}

.bras-player__offline b { font-size: 12px; font-weight: 500; }

.pl12.is-offline .pl12__now,
.pl12.is-offline .pl12__track,
.pl12.is-offline .pl12__play,
.pl12.is-offline .pl12__volume { display: none; }
.pl12.is-offline .bras-player__offline { display: flex; }

/* Keyboard focus keeps the ring the rest of the interface uses */
.pl12 button:focus-visible,
.pl12 a:focus-visible,
.pl12 input:focus-visible,
.pl12__check:focus-visible ~ .pl12__panel .pl12__foldbtn {
	outline: 2px solid var(--pl-accent, #d75531);
	outline-offset: 2px;
}

/* Skeleton until the first data arrives */
.pl-skeleton {
	position: relative;
	overflow: hidden;
	color: transparent !important;
	background-color: var(--pl-hover);
	background-image: none !important;
	border-radius: 6px;
}

.rf-playing-label1.pl-skeleton { max-width: 90px; }
.rf-playing-label2.pl-skeleton { max-width: 180px; }

.pl-skeleton::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(125, 125, 125, 0.25), transparent);
	transform: translateX(-100%);
	animation: plSkeleton 1.4s ease-in-out infinite;
}

@keyframes plSkeleton {
	100% { transform: translateX(100%); }
}

@media screen and (max-width: 575px) {
	.pl12__panel { bottom: 14px; width: 232px; }
	.pl12__now { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pl-skeleton::after { animation: none; }
	.pl12__panel, .pl12__foldbtn svg { transition: none; }
}
