/* Continue watching.

   Colors come from the theme's own custom properties, so the light and dark stylesheets keep
   working without a second copy of these rules.

   The watch bar sits at the bottom of the card and is a separate element from the theme's
   existing .progress-bar, which is the hover animation at the top of the thumbnail and fills
   0-100% on every hover regardless of what was watched. Reusing it would have meant losing that
   effect. */

.card-media .watched-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background-color: rgba(0, 0, 0, 0.45);
	z-index: 2;
	pointer-events: none;
}

.card-media .watched-bar i {
	display: block;
	height: 100%;
	width: 0;
	background-color: rgb(var(--bg-rgb-active-progress-bar));
}

/* The hover preview scales the thumbnail and slides its own bar in at the top; the watch bar
   stays put so the two never read as one control. */
.card-media:hover .watched-bar {
	background-color: rgba(0, 0, 0, 0.6);
}

/* Fallback anchor only. The prompt is normally appended into the player's own .fp-ui layer, which
   is already absolute over the whole player; this covers the case where the player has not built
   its UI and the prompt lands on .player-wrap instead. */
.player-wrap {
	position: relative;
}

/* Inside .fp-ui the stacking context is the player's own. .fp-ui:before is a full-size overlay
   carrying the click-to-play target, so the prompt needs to sit above it - it does so by document
   order already, and the z-index makes that explicit rather than incidental. */
.cw-resume {
	position: absolute;
	left: 12px;
	bottom: 62px;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: calc(100% - 24px);
	padding: 8px 10px 8px 14px;
	border-radius: 10px;
	background-color: rgba(0, 0, 0, 0.82);
	color: #fff;
	font-size: 14px;
	line-height: 1.2;
}

.cw-resume-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cw-resume-go {
	flex: none;
	padding: 6px 12px;
	border: 0;
	border-radius: 6px;
	background-color: rgb(var(--bg-rgb-active-progress-bar));
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.cw-resume-close {
	flex: none;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: transparent;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	opacity: 0.7;
	cursor: pointer;
}

.cw-resume-close:hover {
	opacity: 1;
}

/* The control bar takes a larger share of a small player, so the prompt moves down out of its way
   and drops the padding it cannot afford. */
@media screen and (max-width: 640px) {
	.cw-resume {
		left: 8px;
		right: 8px;
		bottom: 48px;
		max-width: none;
		gap: 8px;
		padding: 6px 6px 6px 10px;
		font-size: 13px;
	}
}

.cw-clear-holder {
	display: flex;
	justify-content: center;
	margin: 10px 0 20px;
}

/* Continue watching skeleton.

   Only the text lines need styling: .card-media already carries the aspect ratio and the item
   background from the theme, so an empty one is a correctly sized placeholder box on its own.
   That is also what keeps the swap for real cards free of any height change. */

.cw-skel-line {
	display: block;
	border-radius: 4px;
	background-color: var(--bg-item);
}

.cw-skel-title {
	height: 14px;
	width: 90%;
	margin-bottom: 8px;
}

.cw-skel-meta {
	height: 12px;
	width: 55%;
}

.cw-skeleton .card-media,
.cw-skel-line {
	animation: cw-skel-pulse 1.4s ease-in-out infinite;
}

@keyframes cw-skel-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.55; }
}

/* Someone who asked for less motion gets the reserved space without the pulsing. */
@media (prefers-reduced-motion: reduce) {
	.cw-skeleton .card-media,
	.cw-skel-line {
		animation: none;
	}
}
