YouTube Player Bottom Bar Top Fix

Positions YouTube's player bottom bar at the top of the video player.

// ==UserScript==
// @name        YouTube Player Bottom Bar Top Fix
// @namespace   http://tampermonkey.net/
// @match       https://www.youtube.com/watch?v=*
// @grant       none
// @version     1.0
// @author      Sergi0
// @description Positions YouTube's player bottom bar at the top of the video player.
// @description:es Posiciona la barra inferior del reproductor de YouTube en la parte superior del reproductor de video.
// @description:fr Positionne la barre inférieure du lecteur YouTube en haut du lecteur vidéo.
// @description:de Positioniert die untere Leiste des YouTube-Players oben am Videoplayer.
// @description:it Posiziona la barra inferiore del lettore YouTube in alto nel lettore video.
// @icon        https://cdn-icons-png.flaticon.com/64/2504/2504965.png
// @license MIT
// @homepage  https://greasyfork.org/es/scripts/540420-youtube-player-bottom-bar-top-fix
// ==/UserScript==

(function() {
    'use strict';

    function applyStylesToElements() {
        const bottomBarElement = document.querySelector('.ytp-chrome-bottom');
        if (bottomBarElement) {
            bottomBarElement.style.setProperty('top', '0', 'important');
            bottomBarElement.style.setProperty('bottom', 'auto', 'important');
        }
    }

    applyStylesToElements();

    const observer = new MutationObserver((mutationsList) => {
        applyStylesToElements();
    });

    observer.observe(document.body, { childList: true, subtree: true, attributes: true });

})();