/*
 * RadioHemp TV — estilos do player.
 * Personalize pelo tema sobrescrevendo as variáveis em .rhtv { --rhtv-accent: ...; }
 */

.rhtv {
	--rhtv-bg: #0d100d;
	--rhtv-surface: #171c17;
	--rhtv-fg: #f1f3ee;
	--rhtv-muted: #98a394;
	--rhtv-accent: #7bc043;
	--rhtv-accent-fg: #0d100d;
	--rhtv-radius: 12px;
	--rhtv-font: inherit;
	--rhtv-lt-font: "Arial Black", "Helvetica Neue", Arial, sans-serif;

	position: relative;
	overflow: hidden;
	border-radius: var(--rhtv-radius);
	background: var(--rhtv-bg);
	color: var(--rhtv-fg);
	font-family: var(--rhtv-font);
	line-height: 1.3;
}

.rhtv *,
.rhtv *::before,
.rhtv *::after {
	box-sizing: border-box;
}

.rhtv .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.rhtv button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

/* Tela ------------------------------------------------------------------ */

.rhtv-screen {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.rhtv-player,
.rhtv-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Marca d'água do canal, como o "bug" da MTV. */
.rhtv-bug {
	position: absolute;
	top: 4%;
	right: 3%;
	display: flex;
	align-items: center;
	gap: .5em;
	max-width: 40%;
	font-weight: 800;
	font-size: clamp(10px, 1.6vw, 16px);
	letter-spacing: .08em;
	text-transform: uppercase;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
	opacity: .8;
	pointer-events: none;
}

.rhtv-bug img {
	max-height: 2.4em;
	width: auto;
}

/* Tarja com artista e música. */
.rhtv-lower-third {
	position: absolute;
	left: 4%;
	bottom: 9%;
	display: flex;
	flex-direction: column;
	max-width: 80%;
	font-family: var(--rhtv-lt-font);
	text-shadow: 0 2px 6px rgba(0, 0, 0, .85), 0 0 2px #000;
	opacity: 0;
	transform: translateX(-12px);
	transition: opacity .4s ease, transform .4s ease;
	pointer-events: none;
}

.rhtv-lower-third.is-visible {
	opacity: 1;
	transform: none;
}

.rhtv-lt-artist {
	font-size: clamp(14px, 2.6vw, 30px);
	font-weight: 900;
	line-height: 1.1;
}

.rhtv-lt-song {
	font-size: clamp(12px, 2vw, 22px);
	font-weight: 400;
	font-family: var(--rhtv-font), sans-serif;
}

.rhtv-lower-third:not(.has-artist) .rhtv-lt-song {
	font-family: var(--rhtv-lt-font);
	font-weight: 900;
	font-size: clamp(14px, 2.6vw, 30px);
}

/* Chiado rápido na troca de vídeo/canal. */
.rhtv-static {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 3px),
		repeating-radial-gradient(circle at 30% 40%, #444 0 1px, #111 1px 2px, #888 2px 3px);
	background-size: 100% 100%, 7px 7px;
}

.rhtv-static.is-on {
	animation: rhtv-static .45s steps(6) both;
}

@keyframes rhtv-static {
	0%   { opacity: .95; background-position: 0 0, 0 0; }
	50%  { opacity: .8;  background-position: 0 2px, 3px 5px; }
	100% { opacity: 0;   background-position: 0 4px, 6px 1px; }
}

/* Botão inicial "Sintonizar". */
.rhtv-start {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .6em;
	width: 100%;
	border: 0;
	background: radial-gradient(circle at center, rgba(123, 192, 67, .18), rgba(0, 0, 0, .92) 70%);
}

.rhtv-start-icon {
	display: grid;
	place-items: center;
	width: clamp(56px, 10vw, 96px);
	aspect-ratio: 1;
	padding-left: .15em;
	border-radius: 50%;
	background: var(--rhtv-accent);
	color: var(--rhtv-accent-fg);
	font-size: clamp(22px, 4vw, 40px);
	transition: transform .2s ease;
}

.rhtv-start:hover .rhtv-start-icon,
.rhtv-start:focus-visible .rhtv-start-icon {
	transform: scale(1.08);
}

.rhtv-start-label {
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.rhtv.is-started .rhtv-start {
	display: none;
}

.rhtv-sound-hint {
	position: absolute;
	top: 4%;
	left: 3%;
	padding: .5em .9em;
	border: 0;
	border-radius: 999px;
	background: var(--rhtv-accent);
	color: var(--rhtv-accent-fg) !important;
	font-weight: 700;
	font-size: 14px;
}

.rhtv-message {
	position: absolute;
	inset: auto 0 45% 0;
	margin: 0;
	text-align: center;
	color: var(--rhtv-muted);
}

/* Barra de controles ---------------------------------------------------- */

.rhtv-bar {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 10px;
	background: var(--rhtv-surface);
}

.rhtv-btn {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
}

.rhtv-btn svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.rhtv-btn:hover,
.rhtv-btn:focus-visible {
	background: rgba(255, 255, 255, .08);
}

.rhtv-btn[aria-pressed="true"][data-rhtv-action="shuffle"] {
	color: var(--rhtv-accent);
}

.rhtv-btn .rhtv-icon-muted,
.rhtv-btn[aria-pressed="true"] .rhtv-icon-sound {
	display: none;
}

.rhtv-btn[aria-pressed="true"] .rhtv-icon-muted {
	display: block;
}

.rhtv-btn[hidden] {
	display: none;
}

.rhtv-now {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	padding: 0 8px;
}

.rhtv-now-channel {
	color: var(--rhtv-accent);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.rhtv-now-title {
	overflow: hidden;
	font-size: 14px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Guia de canais -------------------------------------------------------- */

.rhtv-guide {
	display: flex;
	gap: 8px;
	padding: 10px;
	overflow-x: auto;
	scrollbar-width: thin;
	border-top: 1px solid rgba(255, 255, 255, .06);
}

.rhtv-channel {
	display: flex;
	flex-direction: column;
	flex: none;
	align-items: flex-start;
	min-width: 130px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 8px;
	background: transparent;
	text-align: left;
}

.rhtv-channel:hover,
.rhtv-channel:focus-visible {
	border-color: rgba(255, 255, 255, .3);
}

.rhtv-channel.is-active {
	border-color: var(--rhtv-accent);
	background: var(--rhtv-accent);
	color: var(--rhtv-accent-fg);
}

.rhtv-channel-name {
	font-weight: 700;
	font-size: 14px;
}

.rhtv-channel-count {
	font-size: 12px;
	opacity: .7;
}

/* Tela cheia ------------------------------------------------------------ */

.rhtv.is-fullscreen {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	border-radius: 0;
}

.rhtv.is-fullscreen .rhtv-screen {
	flex: 1;
	aspect-ratio: auto;
}

.rhtv.is-fullscreen .rhtv-guide {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.rhtv-static.is-on {
		animation: none;
	}
	.rhtv-lower-third {
		transition: none;
	}
}
