/* RF Napisy – styl kinowy. Kolory i rozmiar można nadpisać w motywie, np.:
   .rfn { --rfn-sub-fg: #ffd400; --rfn-sub-size: 24px; --rfn-accent: #0055a4; } */
.rfn {
	--rfn-accent: #e63946;
	--rfn-sub-bg: #000;
	--rfn-sub-fg: #f5f5f5;
	--rfn-sub-size: clamp(15px, 2.3vw, 22px);
	--rfn-sub-font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
	--rfn-line-hover: rgba(127, 127, 127, 0.12);
	margin: 1.5em 0;
}

/* Jeden czarny blok: obraz + pas z napisami, bez żadnej przerwy */
.rfn-stage {
	background: var(--rfn-sub-bg);
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

/* Player 16:9 */
.rfn-player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}
.rfn-player iframe,
.rfn-player > div {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	display: block;
}

/* Kinowy pas z napisami – tuż POD obrazem (nie na nim, zgodnie z zasadami YouTube).
   Stała wysokość na 2 linijki, żeby strona nie skakała przy zmianie napisu. */
.rfn-sub {
	position: relative;
	background: var(--rfn-sub-bg);
	color: var(--rfn-sub-fg);
	font-family: var(--rfn-sub-font);
	font-size: var(--rfn-sub-size);
	font-weight: 500;
	line-height: 1.32;
	letter-spacing: 0.01em;
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6);
	min-height: calc(2 * 1.32em + 0.9em);
	padding: 0.45em 1.2em 0.45em;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}
.rfn-sub-text {
	display: block;
	max-width: 46em;
	white-space: pre-line;
	text-wrap: balance;
}
.rfn-sub-text.is-in { animation: rfn-fade 0.18s ease-out; }
@keyframes rfn-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.rfn.subs-off .rfn-sub-text { visibility: hidden; }

/* Dyskretne przyciski w prawym dolnym rogu pasa */
.rfn-controls {
	display: flex;
	justify-content: flex-end;
	gap: 4px;
	padding: 0 8px 6px;
	background: var(--rfn-sub-bg);
}
.rfn-btn {
	appearance: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.5);
	border: 0;
	border-radius: 3px;
	padding: 3px 8px;
	font: 12px/1.4 var(--rfn-sub-font);
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	transition: color 0.15s, background 0.15s;
}
.rfn-btn:hover,
.rfn-btn:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	outline: none;
}
.rfn-btn[aria-pressed="false"] { color: rgba(255, 255, 255, 0.3); }

/* Własny pełny ekran: obraz na górze, kinowy pas na dole */
.rfn-stage.is-fullscreen {
	display: flex;
	flex-direction: column;
	width: 100vw;
	height: 100vh;
	border-radius: 0;
	box-shadow: none;
}
.rfn-stage.is-fullscreen .rfn-player {
	flex: 1 1 auto;
	aspect-ratio: auto;
	min-height: 0;
}
.rfn-stage.is-fullscreen .rfn-sub {
	--rfn-sub-size: clamp(22px, 2.8vw, 40px);
}

/* Lista wersów */
.rfn-lyrics { margin-top: 1em; }
.rfn-lyrics > summary {
	cursor: pointer;
	font-weight: 700;
	margin-bottom: 0.5em;
}
.rfn-lines {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 420px;
	overflow-y: auto;
	overscroll-behavior: contain;
	position: relative;
}
.rfn-line { margin: 0; padding: 0; }
.rfn-line-btn {
	appearance: none;
	display: flex;
	gap: 0.9em;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	border-left: 3px solid transparent;
	padding: 0.35em 0.6em;
	font: inherit;
	color: inherit;
	cursor: pointer;
	border-radius: 0 4px 4px 0;
}
.rfn-line-btn:hover,
.rfn-line-btn:focus-visible { background: var(--rfn-line-hover); outline: none; }
.rfn-time {
	flex: 0 0 auto;
	min-width: 3.2em;
	opacity: 0.5;
	font-variant-numeric: tabular-nums;
	font-size: 0.85em;
	padding-top: 0.15em;
}
.rfn-line.is-active .rfn-line-btn {
	border-left-color: var(--rfn-accent);
	background: var(--rfn-line-hover);
	font-weight: 700;
}
.rfn-line.is-active .rfn-time { opacity: 1; color: var(--rfn-accent); }

.rfn-error {
	padding: 0.6em 0.8em;
	border: 1px dashed #c00;
	color: #c00;
	font-size: 14px;
}
