(function() {
    'use strict';

    let transparencyEnabled = false;
    let transparencyStyle = null;

    // Основной контейнер и все его потомки
    const TARGET_SELECTOR = '._1678bwbEqQ32dlzNLbMiLJ--split.ZHwlNNJLOSOUqK5iKpS2L--coding, ._1678bwbEqQ32dlzNLbMiLJ--split.ZHwlNNJLOSOUqK5iKpS2L--coding *';

    function enableTransparency() {
        if (transparencyEnabled) return;
        // Применяем прозрачный фон только к указанному контейнеру и его дочерним элементам
        const css = `${TARGET_SELECTOR} { background: transparent !important; }`;
        const style = document.createElement('style');
        style.id = 'ishak-transparency-style';
        style.textContent = css;
        document.head.appendChild(style);
        transparencyStyle = style;
        transparencyEnabled = true;
        localStorage.setItem('transparencyEnabled', 'true');
    }

    function disableTransparency() {
        if (!transparencyEnabled) return;
        if (transparencyStyle) {
            transparencyStyle.remove();
            transparencyStyle = null;
        }
        transparencyEnabled = false;
        localStorage.setItem('transparencyEnabled', 'false');
    }

    function loadTransparencyState() {
        return localStorage.getItem('transparencyEnabled') === 'true';
    }

    function initTransparency() {
        if (loadTransparencyState()) {
            enableTransparency();
        }
    }

    window.enableTransparency = enableTransparency;
    window.disableTransparency = disableTransparency;
    window.loadTransparencyState = loadTransparencyState;
    window.initTransparency = initTransparency;
})();