/* ============ КУРСОР ============ */

/* По умолчанию на всех устройствах показываем дефолтный курсор */
* {
    cursor: default !important;
}

/* Когда кастомный курсор включён — скрываем дефолтный */
body.cursor-enabled * {
    cursor: none !important;
}

/* Когда кастомный курсор выключен — показываем дефолтный */
body.cursor-disabled * {
    cursor: default !important;
}

/* На мобильных и тач-устройствах СКРЫВАЕМ ВСЁ */
@media (hover: none) and (pointer: coarse) {
    #custom-cursor {
        display: none !important;
    }
    
    #foamCanvas {
        display: none !important;
    }
    
    /* На мобильных скрываем ВСЕ курсоры */
    body.cursor-enabled *,
    body.cursor-disabled *,
    * {
        cursor: none !important;
    }
}

/* На десктопе показываем кастомный курсор когда он включён */
@media (hover: hover) and (pointer: fine) {
    #custom-cursor {
        display: block !important;
    }
    
    #foamCanvas {
        display: block !important;
    }
    
    /* Если курсор выключен — скрываем кастомный */
    body.cursor-disabled #custom-cursor {
        display: none !important;
    }
    
    body.cursor-disabled #foamCanvas {
        display: none !important;
    }
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2147483647 !important;
    transform: translate(-50%, -50%);
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 0 30px rgba(255, 165, 50, 0.4));
}

#custom-cursor svg {
    width: 32px;
    height: 32px;
    display: block;
    transition: transform 0.2s ease;
}

/* При наведении на интерактивные элементы - поворачиваем SVG */
#custom-cursor.pointer svg {
    transform: rotate(45deg);
}

/* ============ ПАРТИКЛЫ ============ */
#foamCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2147483647 !important;
}

/* Планшеты — тоже скрываем всё */
@media (hover: none) and (pointer: coarse) and (min-width: 768px) {
    #custom-cursor {
        display: none !important;
    }
    
    #foamCanvas {
        display: none !important;
    }
    
    * {
        cursor: none !important;
    }
}
