/**
 * End-of-playback card: review ask + "watch more" recommendations.
 *
 * The JS appends the card to document.body, so without this it renders at the
 * very bottom of a long watch page and is effectively invisible. Positioned
 * fixed, bottom-right on desktop and full-width along the bottom on phones.
 *
 * Deliberately NOT a modal: the film has just ended, the player is still there,
 * and nothing here should block it or steal the page. No overlay, no scroll
 * lock, and the card never covers the centre of the viewport.
 */

.castv-review-prompt {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 9998; /* under the player's own fullscreen chrome, over page content */
	width: 380px;
	max-width: calc( 100vw - 32px );
	padding: 16px 18px 14px;
	border: 1px solid rgba( 255, 255, 255, 0.14 );
	border-radius: 10px;
	background: #16161a;
	color: #f2f2f4;
	box-shadow: 0 10px 34px rgba( 0, 0, 0, 0.5 );
	font-size: 14px;
	line-height: 1.45;
	animation: castv-review-prompt-in 220ms ease-out;
}

@keyframes castv-review-prompt-in {
	from { opacity: 0; transform: translateY( 10px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

/* Someone who has asked for less motion gets none. */
@media ( prefers-reduced-motion: reduce ) {
	.castv-review-prompt { animation: none; }
}

.castv-review-prompt:focus {
	outline: 2px solid #c0392b;
	outline-offset: 2px;
}

.castv-review-prompt-heading {
	margin: 0 24px 6px 24px;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
}

.castv-review-prompt-body {
	margin: 0 0 14px;
	color: #c9c9d1;
	text-align: center;
}

/* One action left, so centre it rather than leaving it hanging on the left
   where the removed opt-out link used to balance it. */
.castv-review-prompt-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}

.castv-review-prompt-write {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 6px;
	background: #c0392b;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.castv-review-prompt-write:hover,
.castv-review-prompt-write:focus {
	background: #a93226;
	color: #fff;
	text-decoration: none;
}

.castv-review-prompt-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	color: #9a9aa4;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.castv-review-prompt-close:hover,
.castv-review-prompt-close:focus {
	color: #fff;
	background: rgba( 255, 255, 255, 0.08 );
}

/* "Watch more films" row: up to 4 cards, beneath the review ask (or alone,
   once the review ask has been permanently dismissed). */
.castv-review-prompt-recs-heading {
	margin: 4px 0 8px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
}

.castv-review-prompt-recs {
	display: flex;
	gap: 10px;
	justify-content: center;
	overflow-x: auto;
	padding-bottom: 2px;
	/* Only the review ask has a right margin reserved for the close button;
	   when the row renders alone it still needs to clear it. */
	scrollbar-width: thin;
}

.castv-review-prompt-rec {
	display: flex;
	flex-direction: column;
	flex: 0 0 84px;
	color: inherit;
	text-decoration: none;
}

.castv-review-prompt-rec:hover .castv-review-prompt-rec-title,
.castv-review-prompt-rec:focus .castv-review-prompt-rec-title {
	color: #fff;
	text-decoration: underline;
}

.castv-review-prompt-rec-poster {
	width: 84px;
	height: 118px; /* fixed 2:3 aspect - a missing image never collapses the row */
	border-radius: 6px;
	background: #232328;
	object-fit: cover;
	margin-bottom: 4px;
}

.castv-review-prompt-rec-title {
	font-size: 12px;
	font-weight: 600;
	color: #f2f2f4;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.castv-review-prompt-rec-meta {
	font-size: 11px;
	color: #9a9aa4;
	margin-top: 2px;
}

@media ( max-width: 600px ) {
	.castv-review-prompt {
		right: 8px;
		left: 8px;
		bottom: 8px;
		width: auto;
		max-width: none;
	}

	.castv-review-prompt-recs {
		/* Horizontally scrollable film row on small screens. */
		margin-right: -4px;
	}
}
